package com.annotation;

import org.aspectj.lang.ProceedingJoinPoint;
import org.aspectj.lang.annotation.Around;
import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.annotation.Pointcut;
import org.springframework.stereotype.Component;

@Component
@Aspect
public class AuthValidAspect {

    @Pointcut("@annotation(com.annotation.AuthValid)")
    private void anyMethod() {
    }

    @Around(value = "anyMethod()")
    public Object doAround(ProceedingJoinPoint pjp) throws Throwable {
        System.out.println("get in aop");
        return pjp.proceed();
    }
}
